<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script>
$(function(){
	$("#state").val("<#if demand??>${demand.state}</#if>");
	$("#state").val("<#if demand??>${demand.state2}</#if>");
});

function starquery(){
	window.location.href="${contextPath}/index/demandList.htm?nickname3="+$("#nickname3").val()+"&title="+$("#titles").val()+"&state="+$("#state").val();
}
</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v2.0 beta</li>
			<li>&gt;</li>
			<li>工作管理</li>
			<li>&gt;</li>
			<li class="current">特殊部门工作情况</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">部门工作情况</div>
		
		<table class="form_table">
			<tbody>
			<tr class="even_row">
				<td>
					<label>筛选：</label>
					<input type="text" id="titles" size="18" value="<#if demand??>${demand.title}</#if>" placeholder="请输入项目标题">
					<input type="text" id="nickname3" size="18" value="<#if demand??>${demand.nickname3}</#if>" placeholder="请输入开发人姓名">
					<select id="state">
						<option value="">全部</option>
						<option value="1">待开发</option>
						<option value="2">正在开发</option>
						<option value="3">已完成</option>
						<option value="4">未完成</option>
					</select>
					<input type="button" value=" 查询 " onclick="starquery()">
					<#if webutil.getCookieUser().username=="system" || webutil.getCookieUser().username=="wangmengyuan">	
						<a href="${contextPath}/index/addDemand.htm"><input type="button" value=" 添加需求 "></a>
					</#if>
				</td>
			</tr>
			</tbody>
		</table>
		
		<table>
			<tr class="fields">
				<th>编号</th>
				<th width="170px">需求名称</th>
				<th>类型</th>
				<th>等级</th>
				<th>开发人</th>
				<th>跟进人</th>
				<th>开始时间</th>
				<th>预计结束时间</th>
				<th>开发状态</th>
				<th>登记日期</th>
				<th>实际完成日期</th>
				<th>操作</th>
			</tr>
			
			
			<#list list as list>
				<tr class="even_row">
					<td align="center">
						${list.id}
					</td>
					<td align="center" title="${list.title}" style="font-weight: bold;">
					<#if list.title?length gt 10>${list.title?substring(0,10)}...<#else>${list.title}</#if>
					</td>
					<td align="center">
						<#if list.type=="1">
							OA系统
						<#elseif list.type=="2">
							前端
						<#elseif list.type=="3">
							IOS
						<#elseif list.type=="4">
							训练系统
						</#if>
					</td>
					<td align="center">
						<#if list.grade=="1">
							A
						<#elseif list.grade=="2">
							B
						<#elseif list.grade=="3">
							C
						<#else>
							无
						</#if>
					</td>
					<td align="center" style="color: #c60;font-weight: bold;">${list.nickname3} &nbsp; ${list.nickname4}</td>
					<td align="center">${list.nickname2}</td>
					<td align="center">${list.startTime}</td>
					<td align="center">${list.endTime}</td>
					<td align="center">
						<#if list.state=="1">
							<span style="color:#1B16E6;">待开发</span>
						<#elseif list.state=="2">
							<span style="color:red;">开发中</span>
						<#elseif list.state=="3">
							<span>已完成</span>
						</#if>
					</td>
					<td align="center">${list.create_time?date}</td>
					<td align="center">${list.com_date}</td>
					<td align="center">
					<#if webutil.getCookieUser().username=="system" || webutil.getCookieUser().username=="dujingyu">	
						<a href="${contextPath}/index/addDemand.htm?id=${list.id}">编辑</a>-
					</#if>
						<a href="${contextPath}/index/demandDetail.htm?id=${list.id}">查看</a>
					</td>
				</tr>
			</#list>
			
			
		</table>
	</div>
	<div id="pager" style="width: 820px;">
	<ul id="pagination">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
				<#if currpage==1 >
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/index/demandList.htm?currPage=${currpage-1}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">上一页</a></li>
					</#if>
					
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/demandList.htm?currPage=${index_up}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/demandList.htm?currPage=${index_up}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/demandList.htm?currPage=${pagetotal}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/demandList.htm?currPage=1&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/demandList.htm?currPage=${index_up}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/demandList.htm?currPage=${pagetotal}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/index/demandList.htm?currPage=1&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/demandList.htm?currPage=${index_up}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/demandList.htm?currPage=${currpage+1}&state=${demand.state}&state2=${demand.state2}&nickname3=${demand.nickname3}">下一页</a></li>
		</#if>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul>
	</div>
	<div class="emptyline clear"></div>
</body>
</html>